import CScriptMgr from "../SuperMgr/cSpriteMgr"
import cEnumMgr from "../Enum/cEnumMgr"
import cEnumMds from "../Enum/cEnumMds"
import cEnumMsg from "../Enum/cEnumMsg"
//数据模块
export default class CDataMgr extends CScriptMgr {

     //数据映射-[name]
     public static g_mapDatabase:Map<string,any> = new Map();
     constructor(){
        super(cEnumMds.datasModule);
    }
 
    //获取数据
    public static getData(name:string):any{
       return CDataMgr.g_mapDatabase[name];
    }
 
    //设置数据
    public static setData(name:string,data:any){
       CDataMgr.g_mapDatabase[name] = data;
    }

    //登陆数据
    public static getLogin():s2c_loginResult{
        return CDataMgr.g_mapDatabase[cEnumMsg.s2c_loginResult]
    }

    //登陆数据
    public static getClubs():s2c_clubClubs{
        return CDataMgr.g_mapDatabase[cEnumMsg.s2c_clubClubs]
    }

    public dispatchs(data:msgBody) {
        let cmd = data.cmds.pop()
        if(cmd == cEnumMgr.succeed){
        }
    }
}